package com.example.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName biz_parts
 */
@TableName(value ="biz_parts")
@Data
public class BizParts implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer partsid;

    /**
     * 
     */
    private String partsname;

    /**
     * 
     */
    private String partsmodel;

    /**
     * 
     */
    private String partsloc;

    /**
     * 
     */

//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date partsprodate;

    /**
     * 
     */
    private String partsremark;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BizParts other = (BizParts) that;
        return (this.getPartsid() == null ? other.getPartsid() == null : this.getPartsid().equals(other.getPartsid()))
            && (this.getPartsname() == null ? other.getPartsname() == null : this.getPartsname().equals(other.getPartsname()))
            && (this.getPartsmodel() == null ? other.getPartsmodel() == null : this.getPartsmodel().equals(other.getPartsmodel()))
            && (this.getPartsloc() == null ? other.getPartsloc() == null : this.getPartsloc().equals(other.getPartsloc()))
            && (this.getPartsprodate() == null ? other.getPartsprodate() == null : this.getPartsprodate().equals(other.getPartsprodate()))
            && (this.getPartsremark() == null ? other.getPartsremark() == null : this.getPartsremark().equals(other.getPartsremark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPartsid() == null) ? 0 : getPartsid().hashCode());
        result = prime * result + ((getPartsname() == null) ? 0 : getPartsname().hashCode());
        result = prime * result + ((getPartsmodel() == null) ? 0 : getPartsmodel().hashCode());
        result = prime * result + ((getPartsloc() == null) ? 0 : getPartsloc().hashCode());
        result = prime * result + ((getPartsprodate() == null) ? 0 : getPartsprodate().hashCode());
        result = prime * result + ((getPartsremark() == null) ? 0 : getPartsremark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", partsid=").append(partsid);
        sb.append(", partsname=").append(partsname);
        sb.append(", partsmodel=").append(partsmodel);
        sb.append(", partsloc=").append(partsloc);
        sb.append(", partsprodate=").append(partsprodate);
        sb.append(", partsremark=").append(partsremark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}